<template>
    <div class="layout-header-container">
        <div class="layout-header-left">
            <img class="layout-header-left-img" src="../../assets/logo.png" alt="">
            <h4 class="layout-header-left-title m1-3">书籍出版表</h4>
        </div>
        <div class="layout-header-right">
            <button type="button" class="btn btn-light" @click="onLogout">退出</button>
        </div>
    </div>
</template>

<script setup>
import { useRouter } from 'vue-router'
const router = useRouter()
const onLogout = () => {
    localStorage.removeItem('token')
    router.push('/login')
}
</script>







<style lang="less" scoped>
.layout-header-container {
  height: 60px;
  border-bottom: 1px solid #dce0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  background: linear-gradient(90deg, #4a90a2, #6fc7d6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;

  .layout-header-left {
    display: flex;
    align-items: center;
    color: #fff;
  }
}

.layout-header-left-img {
  height: 40px;
  width: 50px; /* 添加宽度 */
  border-radius: 50%; /* 变为圆形 */
  margin-right: 10px;
  object-fit: cover; /* 图片自适应容器 */
}

.layout-header-left-title {
  font-size: 18px;
  margin: 0;
  font-weight: bold;
}

.layout-header-right {
  .btn {
    background-color: #fff;
    color: #4a90a2;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: all 0.3s ease;
  }

  .btn:hover {
    background-color: #e0f7fa;
    color: #2c3e50;
    transform: translateY(-2px);
  }

  .btn:active {
    transform: translateY(0);
  }
}

.layout-header-left-img {
  height: 50px;
}
.layout-header-right{
  .btn{
   background-color: #5f9ea0;
   color: #fff;
  }
  .btn:hover{
    color: #999;
    opacity: 0.5;
    background-color: #fff;
  }
}
</style>